    import React from 'react'
        import { useSelector,useDispatch} from 'react-redux' 
        
        import * as countModule from "../store/reduxs/count"
    export default function Counteradd() {
        
        const count=useSelector((state)=>{
                    console.log("statepp",state);
                return state.counter.count
        })
        const dispatch=useDispatch()
        function changeCount(){
            dispatch({
                type:"add",
                payload:2
            })
        }

        function asyncChangeName(){

            dispatch(countModule.asyncAdd(2))

        }
      return (
        <div>Counteradd {count}  <button onClick={changeCount}>加</button> <button onClick={asyncChangeName}>async 异步</button></div>
      )
    }
    